<?php 
    // Get apache version
    function apache_version()
    {
            if (function_exists('apache_get_version'))
            {
                    if (preg_match('|Apache\/(\d+)\.(\d+)\.(\d+)|', apache_get_version(), $version))
                    {
                            return $version[1].'.'.$version[2].'.'.$version[3];
                    }
            }
            elseif (isset($_SERVER['SERVER_SOFTWARE']))
            {
                    if (preg_match('|Apache\/(\d+)\.(\d+)\.(\d+)|', $_SERVER['SERVER_SOFTWARE'], $version))
                    {
                            return $version[1].'.'.$version[2].'.'.$version[3];
                    } 
            }

            return '(unknown)';
    }
    echo $this->doctype();
    echo "<html><head>";
	echo $this->headTitle( ' :: ' . SYS_NAME . ' :: '  ); 
	echo $this->headMeta()->appendHttpEquiv('Content-Type','text/html; charset=UTF-8')
						  ->appendHttpEquiv('Content-Language','en-US');
	echo $this->headLink()->appendStylesheet( PATH_CSS . 'jquery-ui-1.8.12.custom.css' )
						  ->appendStylesheet( PATH_CSS . 'mini.php?files=reset,common,form,standard,960.gs.fluid,simple-lists,block-lists,planning,table,calendars,wizard,gallery' )	
						  ->appendStylesheet( PATH_JS . 'libs/jquery/alerts/jquery.alerts.css' )
                                                  ->appendStylesheet( PATH_CSS . 'main.css' );
	echo $this->headScript()->appendFile( PATH_JS.'libs/voitech/config.js' )
                                ->appendFile( PATH_JS.'libs/php.default.min.js' )
                                ->appendFile( PATH_JS.'libs/mascara.js' )
						    ->appendFile( PATH_JS.'libs/jquery/jquery-1.5.1.min.js' )
					        ->appendFile( PATH_JS.'libs/jquery/jquery-ui-1.8.12.custom.min.js' )
					        ->appendFile( PATH_JS.'libs/jquery/jquery.blockUI.js' )	
					        ->appendFile( PATH_JS.'libs/jquery/jquery.PrintArea.js' )								        	        
					        ->appendFile( PATH_JS.'libs/jquery/alerts/jquery.alerts.js' )
                            ->appendFile( PATH_JS.'libs/voitech/util.js' )
					        ->appendFile( PATH_JS.'funcoes.js' )
					        ->appendFile( PATH_JS.'libs/voitech/action.js' )
					        //->appendFile( PATH_JS.'libs/admin/mini.php?files=html5,old-browsers,jquery.accessibleList,searchField,common,standard,jquery.tip,jquery.hashchange,jquery.contextMenu,jquery.modal,list' )
					        ->appendFile( PATH_JS.'libs/admin/jquery.dataTables.min.js' )
					        ->appendFile( PATH_JS.'libs/admin/jquery.datepick/jquery.datepick.min.js' );						  
	echo "</head>";
?>
	<body>
		<!-- The template uses conditional comments to add wrappers div for ie8 and ie7 - just add .ie or .ie7 prefix to your css selectors when needed -->
		<!--[if lt IE 9]><div class="ie"><![endif]-->
		<!--[if lt IE 8]><div class="ie7"><![endif]-->
                
<?php if( $this->user )  { ?>

	
		<!-- Server status -->
		<header><div class="container_12">
                        
			<p id="skin-name"><strong>SISGEF 1.0 </strong></p>
			<div class="server-info" id="Data">Brasília, 
			<?php $hr = date("H:i", mktime(gmdate("H")-3, gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y")));
						$dia = date("d", mktime(gmdate("H")-3, gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y")));
						$mês = date("n", mktime(gmdate("H")-3, gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y")));
						$ano = date("Y", mktime(gmdate("H")-3, gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y")));
						$dia_sem = date("w", mktime(gmdate("H")-3, gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y")));  
						
						$meses = array( 1=> "janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"); 
						
						$semanas = array("Domingo", "Segunda-Feira", "Terça-Feira", "Quarta-Feira", "Quinta-Feira", "Sexta-Feira", "Sábado");
						
						echo "$semanas[$dia_sem], $dia de $meses[$mês] de $ano";  
			?></div>
			<div class="server-info" id="Clock"><strong>Última ação:</strong> <?php echo $hr; ?></div>
			
		</div></header>
		<!-- End server status -->		
		<!-- Main nav -->
		<nav id="main-nav">
                    <ul class="container_12">
                        <li class="home current">
                            <a href="#" title="Meu Computador">Cadastro</a>
                            <ul>
                                <li><a href="<?php echo PATHAMBIENTE ?>" title="Principal">Principal</a></li>
                                
								<li class="with-menu"><a href="#" title="Cadastros do Sistema">Cadastros do Sistema</a>
									<div class="menu">
										<img src="<?php echo PATHAMBIENTE ?>images/menu-open-arrow.png" width="16" height="16">
										<ul>
											<li class="sep"></li>
											<li class="icon_address"><a href="<?php echo PATHAMBIENTE ?>pessoa" title="Pessoa">Pessoas</a></li>
											<li class="sep"></li>
											<li class="icon_export"><a href="<?php echo PATHAMBIENTE ?>fornecedor" title="Fornecedor">Fornecedores</a></li>
											<li class="sep"></li>
											<li class="icon_terminal"><a href="<?php echo PATHAMBIENTE ?>unidade" title="Unidade">Unidades</a></li>
                                                                                        <li class="sep"></li>
											<li class="icon_terminal"><a href="<?php echo PATHAMBIENTE ?>usuario" title="Usuario">Usuarios</a></li>
										</ul>
									</div>
								</li>                                
                                
								<li class="with-menu"><a href="#" title="Manter Produtos">Manter Produtos</a>
									<div class="menu">
										<img src="<?php echo PATHAMBIENTE ?>images/menu-open-arrow.png" width="16" height="16">
										<ul>
											<li class="sep"></li>
											<li class="icon_building"><a href="<?php echo PATHAMBIENTE ?>categoria" title="Tipo">Categorias de Produtos</a></li>
											<li class="sep"></li>
											<li class="icon_computer"><a href="<?php echo PATHAMBIENTE ?>tipo-produto" title="Tipo">Unidades de Produtos</a></li>
											<li class="sep"></li>
											<li class="icon_search"><a href="<?php echo PATHAMBIENTE ?>produto" title="Unidade">Cadastro de Produtos</a></li>
										</ul>
									</div>
								</li>                                  
                                
                                <li><a href="<?php echo PATHAMBIENTE ?>compra" title="Compra">Entrada de Compras</a></li>
                                <li><a href="<?php echo PATHAMBIENTE ?>distribuicao" title="DIstribuição">Distribuição para Unidades</a></li>
                                
								<li class="with-menu"><a href="#" title="Relatórios">Relatórios</a>
									<div class="menu">
										<img src="<?php echo PATHAMBIENTE ?>images/menu-open-arrow.png" width="16" height="16">
										<ul>
											<li class="sep"></li>
											<li class="icon_doc_excel"><a href="<?php echo PATHAMBIENTE ?>relatorio/pesquisar-produto-compra" title="Relatorio">Entrada de Compras</a></li>
											<li class="sep"></li>
											<li class="icon_doc_excel"><a href="<?php echo PATHAMBIENTE ?>relatorio/pesquisar-produto-distribuicao" title="Relatorio">Distribuição para Unidades</a></li>
											<li class="sep"></li>
										</ul>
									</div>
								</li>                                  
                            </ul>
                        </li>                               
                    </ul>
		</nav>
		<!-- End main nav -->


	
		<!-- Sub nav -->
		<div id="sub-nav"><div class="container_12">
				
		</div></div>
		<!-- End sub nav -->
		

		<!-- Status bar -->
		<div id="status-bar"><div class="container_12">
		
			<ul id="status-infos">
				<li class="spaced">BEM VINDO(A), <strong><?php echo strtoupper( $this->user->getNoUsuario() ); ?></strong></li>
				<li><a href="<?php echo PATHAMBIENTE.'autenticacao/logof'?>" class="button red" title="Logout"><span class="smaller">Sair do Sistemas</span></a></li>
			</ul>
			
<!--			<ul id="breadcrumb">
				<li><a href="#" title="Home">Home</a></li>
				<li><a href="#" title="Dashboard">Dashboard</a></li>
			</ul>			-->
		</div></div>
		<!-- End status bar -->
		
		<div id="header-shadow"></div>
		<!-- End header -->
		
<?php }?>	

		<!-- Content -->
		<article class="container_12">
			<section class="grid_12">	
					<div class="block-border">
						 <div class="block-content">
						 
					<!-- Inicio do Conteúdo do sistema -->	
							<h1><?php echo $this->tituloPagina?></h1>
								<div id='content_sys'>                                                                                                                                           
									<?php 	
                                                                            if (isset($this->messages)){
                                                                                echo "<center>";   
                                                                                foreach ($this->messages as $message){ 
                                                                                    echo $message,"<br />";
                                                                                }
                                                                                echo "</center>";
                                                                            }
									    echo $this->layout()->content;
									?>
								</div>
							
							
						</div>
					</div>
			</section>
		<div class="clear"></div>
		</article>	
		
		
					
		<div id="footer">
		
		<!-- begin separator --><hr /><!-- end separator -->
		<center>
			<div class="float_left">
				Copyright &copy; <?php echo ' SISGEF - Sistema de Gerenciamento de Estoque Farmacéutico, '.date('Y');?>. Todos os direitos reservados.
			</div>
			
			<div class="float_right">
				<b>Desenvolvido por </b><a href="http://www.voitech.com.br" target="_blank"><span style="color:orange;">VOITECH SISTEMAS. </span></a>
			</div>
			
			<div class="clear"></div>
		</center>	
		</div><!-- end footer -->						
						
						
	</body>
</html>
